﻿Imports System.Collections.Generic
Imports System.Data
Imports System.Data.SqlClient


''' <summary>
''' Clase de la capa de acceso a datos DAL que implementa el patrón Table Data Gateway para el manejo de la entidad Estado_Usuario
''' </summary>
''' <remarks></remarks>
Public Class TDGEstado_Usuario

    Private Shared m_Instance As TDGEstado_Usuario = Nothing




    Public Function Find(conn As SqlConnection, EstU_Codigo As String) As SqlDataReader
        Dim command As New SqlCommand
        Dim dr As SqlDataReader


        command.Connection = conn
        command.CommandType = CommandType.StoredProcedure

        command.CommandText = "dbo.getEstado_Usuario"
        command.Parameters.AddWithValue("@EstU_Codigo", EstU_Codigo)


        dr = command.ExecuteReader()

        Return dr

    End Function

    Public Function FindAll(conn As SqlConnection) As SqlDataReader
        Dim command As New SqlCommand
        Dim dr As SqlDataReader


        command.Connection = conn
        command.CommandType = CommandType.StoredProcedure

        command.CommandText = "dbo.getEstado_Usuario_ALL"


        dr = command.ExecuteReader()

        Return dr

    End Function

    Public Shared ReadOnly Property Instance()
        Get
            If (m_Instance Is Nothing) Then
                m_Instance = New TDGEstado_Usuario()
            End If

            Return m_Instance
        End Get
    End Property

    Private Sub New()

    End Sub

End Class
